A type of Exclusive Activity Host node, that uses a list of Activity nodes provided by setting a list DataObject, from a DataSource, to the ActivitySourceProperty property. More...
#include <kanzi/ui/node/data_driven_exclusive_activity_host2d.hpp>
Public Types | |
using | ConceptClass |
Data-Driven Exclusive Activity Host 2D concept used to implement this class. | |
Public Types inherited from kanzi::ActivityHostConcept | |
enum class | ActivationStatus { PreparingForActivation , ParallelAnimation , ExclusiveAnimation } |
Specifies possible stages for internal tracking of activation of an Activity. More... | |
using | ActivityInfoContainer |
enum class | DeactivationStatus { ExclusiveAnimation , ParallelAnimation , WaitingForRelease } |
Specifies possible stages for internal tracking of deactivation of an Activity. More... | |
Public Types inherited from kanzi::ExclusiveActivityHostConcept | |
enum class | ExclusiveActivityHostFocusingPolicy { WhenHostHasFocus , AlwaysFocus , NeverFocus } |
Specifies the focusing policy that Kanzi applies to an activating Activity in an Exclusive Activity Host. More... | |
Static Public Member Functions | |
static DataDrivenExclusiveActivityHost2DSharedPtr | create (Domain *domain, string_view name) |
Creates a Data-Driven Exclusive Activity Host 2D node. | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Returns the PropertyType editor information for a Data-Driven Exclusive Activity Host 2D node. | |
Static Public Member Functions inherited from kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D > | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Returns PropertyType editor info of properties of Data-Driven Exclusive Activity Host. | |
Static Public Member Functions inherited from kanzi::ActivityElement | |
static string | getFirstElement (string_view activationSequence) |
Gets the first element of the activation sequence. | |
static string | getRestToForward (string_view activationSequence) |
Gets the remainder of the activation sequence. | |
template<typename Type > | |
static bool | isActivityElement (const Type &object) |
Returns whether an object is an ActivityElement. | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Static Public Member Functions inherited from kanzi::ActivityHostConcept | |
template<typename Type > | |
static bool | isActivityHost (const Type &object) |
Determines if an object is an ActivityHost. | |
static bool | isActivityHostMetaclass (const Metaclass *metaclass) |
Checks whether the given Metaclass is an ActivityHostConcept metaclass or contains it as a mixin metaclass. | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Static Public Member Functions inherited from kanzi::ExclusiveActivityHostConcept | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Returns PropertyType editor info of exclusive activity concept. | |
Static Public Member Functions inherited from kanzi::DataDrivenExclusiveActivityHostConcept | |
static string | getNameForIndex (int index) |
Returns a unique name for the data Activity at the given index in the Data Source List. | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Returns PropertyType editor info of DataDrivenExclusiveActivityHostConcept. | |
Additional Inherited Members | |
Public Member Functions inherited from kanzi::DataDrivenExclusiveActivityHostImpl< ContentLayout2D, DataDrivenExclusiveActivityHost2D > | |
const Node * | getNode () const override |
ExclusiveActivityHostConcept::getNode const implementation. | |
Node * | getNode () override |
ExclusiveActivityHostConcept::getNode implementation. | |
void | initialize () |
Initialize with internal activities factory. | |
Public Member Functions inherited from kanzi::ExclusiveActivityHostBaseImpl< TBaseClass, TDerivedClass > | |
void | onFinishedExclusiveDeactivatingAnimationInternal (const ActivityConcept::StatusChangedInternalMessageArguments &args) |
Message handler for FinishedExclusiveDeactivatingAnimationInternal message. | |
void | onFinishedParallelActivatingAnimationInternal (const ActivityConcept::StatusChangedInternalMessageArguments &args) |
Message handler for FinishedParallelActivatingAnimationInternal message. | |
void | onFinishedParallelDeactivatingAnimationInternal (const ActivityConcept::StatusChangedInternalMessageArguments &args) |
Message handler for FinishedParallelDeactivatingAnimationInternal message. | |
NodeSharedPtr | onPrefabLoaded (PrefabTemplateSharedPtr prefabTemplate, string_view activityName) override |
ExclusiveActivityHostConcept::onPrefabLoaded implementation. | |
void | setActivationModifier (string_view activityName, BindingTokenWeakPtr weakModifier) override |
ActivityHostConcept::setActivationModifier implementation. | |
Public Member Functions inherited from kanzi::ActivityHostConceptImpl< TBaseClass, TDerivedClass > | |
void | deserialize (string_view data) override |
ActivityElement::deserialize implementation. | |
void | notifyChildrenNodeTreeAvailable () override |
ActivityElement::notifyChildrenNodeTreeAvailable implementation. | |
string | serialize () override |
ActivityElement::serialize implementation. | |
Public Member Functions inherited from kanzi::ActivityElement | |
vector< NodeSharedPtr >::const_iterator | beginChildHosts () const |
Returns the begin iterator to the registered child Activity Host. | |
vector< NodeSharedPtr >::const_iterator | endChildHosts () const |
Returns the end iterator to the registered child Activity Host. | |
Node * | findChildHost (string_view hostName) |
Finds a child Activity Host by name. | |
vector< string > | getCommands () const |
Gets the list of commands handled by code behind of this activity element. | |
ActivityHistoryManager * | getHistoryManager () const |
Gets the history manager of this activity element. | |
ActivityElement * | getParentElement () |
Gets the parent ActivityElement type node. | |
bool | isLeafActivityNode () const |
Returns whether an ActivityElement has a child Activity Host. | |
void | setCodeBehind (CodeBehindSharedPtr codeBehind) |
Attaches a code behind object. | |
void | setCodeBehind (const Metaclass *metaclass) |
Instantiates and attaches a code behind object by specifying its metaclass. | |
virtual | ~ActivityElement ()=default |
Destructor. | |
Public Member Functions inherited from kanzi::ActivityHostConcept | |
virtual | ~ActivityHostConcept ()=default |
Destructor. | |
Public Member Functions inherited from kanzi::ExclusiveActivityHostConcept | |
virtual | ~ExclusiveActivityHostConcept ()=default |
Destructor. | |
Public Member Functions inherited from kanzi::DataDrivenExclusiveActivityHostConcept | |
int | getActiveActivityIndex () const |
Gets the value of the ActiveActivityIndexProperty. | |
ResourceSharedPtr | getActivitySource () const |
Gets the value of the ActivitySourceProperty. | |
string | getActivityTemplate () const |
Gets the value of the ActivityTemplateProperty. | |
void | setActiveActivityIndex (int value) |
Sets the value of the ActiveActivityIndexProperty. | |
void | setActivitySource (ResourceSharedPtr value) |
Sets the value of the ActivitySourceProperty. | |
void | setActivityTemplate (string_view prefabUrl) |
Sets the value of the ActivityTemplateProperty. | |
virtual | ~DataDrivenExclusiveActivityHostConcept ()=default |
Destructor. | |
Static Public Attributes inherited from kanzi::ActivityElement | |
static PropertyType< bool > | AttachedProperty |
static PropertyType< bool > | PreserveHistoryProperty |
Enables the preservation of Activity property values when that Activity becomes inactive. | |
Static Public Attributes inherited from kanzi::ActivityHostConcept | |
static MessageType< ActivationMessageArguments > | ActivateActivityMessage |
You can send ActivateActivity to the Activity Host to activate an Activity. | |
static MessageType< ActivationMessageArguments > | DeactivateActivityMessage |
You can send DeactivateActivity to the Activity Host to deactivate an Activity. | |
static MessageType< ActivityPrefabMessageArguments > | ActivityPrefabAttachedMessage |
An Activity Host sends this message when it attaches the prefab of the Activity that is activated. | |
static MessageType< ActivityPrefabMessageArguments > | ActivityPrefabDetachedMessage |
An Activity Host sends this message when it attaches the prefab of the Activity that is activated. | |
static MessageType< RegisterActivityElementInternalMessageArguments > | RegisterHostInternalMessage |
Internal message sent by an Activity Host to its parent Activity or Activity Host to register the Activity Host in the parent. | |
static MessageType< UnregisterActivityElementInternalMessageArguments > | UnregisterHostInternalMessage |
Internal message sent by an Activity Host to its parent Activity or Activity Host to unregister the Activity Host from the parent. | |
Static Public Attributes inherited from kanzi::ExclusiveActivityHostConcept | |
static MessageType< ImplicitActivityChangeRequestMessageArguments > | NavigateNextMessage |
In an Exclusive Activity Host requests the activation of the next Activity node in that Exclusive Activity Host node. | |
static MessageType< ImplicitActivityChangeRequestMessageArguments > | NavigatePreviousMessage |
In an Exclusive Activity Host requests the activation of the previous Activity node in that Exclusive Activity Host node. | |
static PropertyType< string > | ExclusiveActivityHostContentProperty |
Describes the content of an Exclusive Activity Host node. | |
static PropertyType< string > | ActiveActivityProperty |
The name of the child Activity node of an Exclusive Activity Host, that is either in ActivityConcept::Status::Active or in ActivityConcept::Status::Activating state. | |
static PropertyType< string > | ActivationPathProperty |
The activation path containing the branch of the Activity tree that is requested to be activated. | |
static PropertyType< ExclusiveActivityHostFocusingPolicy > | FocusOnActivatingActivityProperty |
Sets the policy that an Exclusive Activity Host uses to decide whether it tries to set focus to an activating Activity. | |
Static Public Attributes inherited from kanzi::DataDrivenExclusiveActivityHostConcept | |
static constexpr const char * | s_activeDataActivityName |
Public name which Kanzi uses to refer to the currently and exclusively active data Activity of a Data-Driven Exclusive Activity Host. | |
static constexpr int | s_defaultActiveActivityIndex |
The default value of the DataDrivenExclusiveActivityHostConcept::ActiveActivityIndexProperty. | |
static PropertyType< ResourceSharedPtr > | ActivitySourceProperty |
Sets the DataObject that provides the data for the Activities of a Data-Driven Exclusive Activity Host. | |
static PropertyType< string > | ActivityTemplateProperty |
Sets the prefab template that a Data-Driven Exclusive Activity Host uses for the Activities that it creates. | |
static PropertyType< int > | ActiveActivityIndexProperty |
The index of the active Activity in the Data-Driven Exclusive Activity Host. | |
Protected Attributes inherited from kanzi::ActivityHostConceptImpl< TBaseClass, TDerivedClass > | |
string | m_activationTarget |
The name of the Activity that is the candidate to be the activation target. | |
bool | m_deserializing |
Indicates that this Activity Host is performing property deserialization. | |
bool | m_hostHadFocus |
Indicates that the Activity Host had focus before it started to activate new activation target Activity. | |
A type of Exclusive Activity Host node, that uses a list of Activity nodes provided by setting a list DataObject, from a DataSource, to the ActivitySourceProperty property.
A child Activity node of a Data-Driven Exclusive Activity Host uses the prefab set in the ActivityTemplateProperty.
An Activity Host node defines the rules for when its Activity nodes are active. Kanzi has these Activity Host nodes:
Data-Driven Exclusive Activity Host and Exclusive Activity Host nodes can have only one of its child Activity nodes active at a time. When one child Activity node of a Data-Driven Exclusive Activity Host or an Exclusive Activity Host node is active, all other Activity nodes of that Activity Host node are inactive.
For example, you can use a Data-Driven Exclusive Activity Host or an Exclusive Activity Host node to toggle between views in your application.
Parallel Activity Host node can activate more than one of its child Activity nodes at a time.
You can add Activity nodes to an Activity Host node in real-time. This enables you to use the Kanzi Engine API to generate Activity nodes or to add to the application another application for which the structure of Activity nodes is not known until you run that application. For example, you can use the Kanzi Engine API to generate a large number of menu pages that you want to show to the user.
The Activity and Activity Host nodes inherit from the ContentLayout class to lay out their content like a Content Layout node. See ContentLayout2D and ContentLayout3D.
See ExclusiveActivityHost2D, ExclusiveActivityHost3D, Activity2D, and Activity3D.
The type of the Activity Host node determines the way you control its child Activity nodes. When you use an Data-Driven Exclusive Activity Host node, you can control its Activity nodes using:
Activate an Activity node on an event, as a one-time action:
When using this approach, keep in mind that actions of a DataTrigger have higher priority than the actions of any other Trigger. For example, if you use a DataTrigger with an ApplyPropertyAction that sets the ActiveActivityIndexProperty to some value and any other Trigger with a SetPropertyAction that sets that same property to a different value, the effect of the SetPropertyAction becomes visible only after Kanzi unapplies the ApplyPropertyAction. See Trigger and SetPropertyAction.
For each Data-Driven Exclusive Activity Host node you can define properties that are specific to that Data-Driven Exclusive Activity Host node. For example, with Data-Driven Exclusive Activity Host node that is attached to a music player, you can toggle music on and off, and change the volume level.
When you create a property for a Data-Driven Exclusive Activity Host node, set the namespace of that property to Activity Property. You can create properties with int, bool, float, and enum data types. If you use code behind for a Data-Driven Exclusive Activity Host, Kanzi adds the properties of that Data-Driven Exclusive Activity Host to the code behind.
The values of these properties implement the state machine and logic of your Kanzi application, which is why Kanzi preserves the values of these properties even when a Data-Driven Exclusive Activity Host is virtual. When Kanzi virtualizes a Data-Driven Exclusive Activity Host, it serializes the properties of that Data-Driven Exclusive Activity Host and when Kanzi devirtualizes that Data-Driven Exclusive Activity Host, it deserializes the state of that Data-Driven Exclusive Activity Host and restores its property values.
Code behind is a workflow where you associate code with an instance of a Data-Driven Exclusive Activity Host instead of a type. In Kanzi Studio in the Activity Browser window, you can generate a code behind stub for any Data-Driven Exclusive Activity Host node. This stub is associated with that particular Data-Driven Exclusive Activity Host and has access to the properties of that Data-Driven Exclusive Activity Host. In code behind you can write code that you can associate with the view or controller parts of the model-view-controller pattern. For example, you can:
Data-Driven Exclusive Activity Host 2D concept used to implement this class.
|
explicitprotected |
Constructor.
domain | The domain the new node belongs to. |
name | The name of the node. |
|
static |
Creates a Data-Driven Exclusive Activity Host 2D node.
domain | The domain the new node belongs to. |
name | The name of the node. |
|
static |
Returns the PropertyType editor information for a Data-Driven Exclusive Activity Host 2D node.